<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The tidy class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="tidy.examples.basic.html">« Tidy example</a></li>
      <li style="float: right;"><a href="tidy.body.html">tidy::body »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.tidy.html">Tidy</a></li>
    <li>The tidy class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.tidy" class="reference">
 <h1 class="title">The <span class="classname"><a href="class.tidy.html" class="classname">tidy</a></span> class</h1>
 
 
 <div class="partintro"><p class="verinfo">(PHP 5, PHP 7, PHP 8, PECL tidy &gt;= 0.5.2)</p>
 

  <div class="section" id="tidy.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    An HTML node in an HTML file, as detected by tidy.
   </p>
  </div>

 
  <div class="section" id="tidy.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">tidy</strong>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span>
      <var class="varname"><a href="tidy.props.errorbuffer.html">$<var class="varname">errorBuffer</var></a></var><span class="initializer"> = null</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span>
      <var class="varname"><a href="class.tidy.html#tidy.props.value">$<var class="varname">value</var></a></var><span class="initializer"> = null</span>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="tidy.construct.html" class="methodname">__construct</a></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$filename</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type">array</span>|<span class="type">string</span>|<span class="type">null</span></span> <code class="parameter">$config</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">bool</span> <code class="parameter">$useIncludePath</code><span class="initializer"> = <strong><code>false</code></strong></span></span><br>)</div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.body.html" class="methodname">body</a></span>(): <span class="type"><span class="type">?</span><span class="type"><a href="class.tidynode.html" class="type tidyNode">tidyNode</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.cleanrepair.html" class="methodname">cleanRepair</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.diagnose.html" class="methodname">diagnose</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>tidy_get_error_buffer</strong></span>(<span class="methodparam"><span class="type"><a href="class.tidy.html" class="type tidy">tidy</a></span> <code class="parameter">$tidy</code></span>): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.getconfig.html" class="methodname">getConfig</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.gethtmlver.html" class="methodname">getHtmlVer</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.getopt.html" class="methodname">getOpt</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$option</code></span>): <span class="type"><span class="type">string</span>|<span class="type">int</span>|<span class="type">bool</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.getoptdoc.html" class="methodname">getOptDoc</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$option</code></span>): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.getrelease.html" class="methodname">getRelease</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.getstatus.html" class="methodname">getStatus</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.head.html" class="methodname">head</a></span>(): <span class="type"><span class="type">?</span><span class="type"><a href="class.tidynode.html" class="type tidyNode">tidyNode</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.html.html" class="methodname">html</a></span>(): <span class="type"><span class="type">?</span><span class="type"><a href="class.tidynode.html" class="type tidyNode">tidyNode</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.isxhtml.html" class="methodname">isXhtml</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.isxml.html" class="methodname">isXml</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.parsefile.html" class="methodname">parseFile</a></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type">array</span>|<span class="type">string</span>|<span class="type">null</span></span> <code class="parameter">$config</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">bool</span> <code class="parameter">$useIncludePath</code><span class="initializer"> = <strong><code>false</code></strong></span></span><br>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>tidy_parse_file</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type">array</span>|<span class="type">string</span>|<span class="type">null</span></span> <code class="parameter">$config</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">bool</span> <code class="parameter">$useIncludePath</code><span class="initializer"> = <strong><code>false</code></strong></span></span><br>): <span class="type"><span class="type"><a href="class.tidy.html" class="type tidy">tidy</a></span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.parsestring.html" class="methodname">parseString</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$string</code></span>, <span class="methodparam"><span class="type"><span class="type">array</span>|<span class="type">string</span>|<span class="type">null</span></span> <code class="parameter">$config</code><span class="initializer"> = <strong><code>null</code></strong></span></span>, <span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>tidy_parse_string</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$string</code></span>, <span class="methodparam"><span class="type"><span class="type">array</span>|<span class="type">string</span>|<span class="type">null</span></span> <code class="parameter">$config</code><span class="initializer"> = <strong><code>null</code></strong></span></span>, <span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type"><span class="type"><a href="class.tidy.html" class="type tidy">tidy</a></span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="tidy.repairfile.html" class="methodname">repairFile</a></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type">array</span>|<span class="type">string</span>|<span class="type">null</span></span> <code class="parameter">$config</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">bool</span> <code class="parameter">$useIncludePath</code><span class="initializer"> = <strong><code>false</code></strong></span></span><br>): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="tidy.repairstring.html" class="methodname">repairString</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$string</code></span>, <span class="methodparam"><span class="type"><span class="type">array</span>|<span class="type">string</span>|<span class="type">null</span></span> <code class="parameter">$config</code><span class="initializer"> = <strong><code>null</code></strong></span></span>, <span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="tidy.root.html" class="methodname">root</a></span>(): <span class="type"><span class="type">?</span><span class="type"><a href="class.tidynode.html" class="type tidyNode">tidyNode</a></span></span></div>

   }</div>


  </div>

  <div class="section" id="tidy.props">
   <h2 class="title">属性</h2>
   <dl>
    
     <dt id="tidy.props.value"><var class="varname">value</var></dt>

     <dd>

      <p class="para">The HTML representation of the node, including the surrounding tags.</p>
     </dd>

    
   </dl>

  </div>


 </div>

 





































































































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="tidy.body.html">tidy::body</a> — Returns a tidyNode object starting from the &lt;body&gt; tag of the tidy parse tree</li><li><a href="tidy.cleanrepair.html">tidy::cleanRepair</a> — Execute configured cleanup and repair operations on parsed markup</li><li><a href="tidy.construct.html">tidy::__construct</a> — Constructs a new tidy object</li><li><a href="tidy.diagnose.html">tidy::diagnose</a> — Run configured diagnostics on parsed and repaired markup</li><li><a href="tidy.props.errorbuffer.html">tidy::$errorBuffer</a> — Return warnings and errors which occurred parsing the specified document</li><li><a href="tidy.getconfig.html">tidy::getConfig</a> — Get current Tidy configuration</li><li><a href="tidy.gethtmlver.html">tidy::getHtmlVer</a> — Get the Detected HTML version for the specified document</li><li><a href="tidy.getopt.html">tidy::getOpt</a> — Returns the value of the specified configuration option for the tidy document</li><li><a href="tidy.getoptdoc.html">tidy::getOptDoc</a> — Returns the documentation for the given option name</li><li><a href="tidy.getrelease.html">tidy::getRelease</a> — Get release date (version) for Tidy library</li><li><a href="tidy.getstatus.html">tidy::getStatus</a> — Get status of specified document</li><li><a href="tidy.head.html">tidy::head</a> — Returns a tidyNode object starting from the &lt;head&gt; tag of the tidy parse tree</li><li><a href="tidy.html.html">tidy::html</a> — Returns a tidyNode object starting from the &lt;html&gt; tag of the tidy parse tree</li><li><a href="tidy.isxhtml.html">tidy::isXhtml</a> — Indicates if the document is a XHTML document</li><li><a href="tidy.isxml.html">tidy::isXml</a> — Indicates if the document is a generic (non HTML/XHTML) XML document</li><li><a href="tidy.parsefile.html">tidy::parseFile</a> — Parse markup in file or URI</li><li><a href="tidy.parsestring.html">tidy::parseString</a> — Parse a document stored in a string</li><li><a href="tidy.repairfile.html">tidy::repairFile</a> — Repair a file and return it as a string</li><li><a href="tidy.repairstring.html">tidy::repairString</a> — Repair a string using an optionally provided configuration file</li><li><a href="tidy.root.html">tidy::root</a> — Returns a tidyNode object representing the root of the tidy parse tree</li></ul>
</div>
</div></div></body></html>